﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace Pc_Vision.View_Datalayer
{
    public partial class viewProductDelete : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void RadGrid1_DeleteCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            DAOFactorys.DAOproduct Dao = new DAOFactorys.DAOproduct();
            Model.Product p = new Model.Product();
            GridDataItem item = (GridDataItem)e.Item;
            string Artikelnummer = item.OwnerTableView.DataKeyValues[item.ItemIndex]["Artikelnummer"].ToString();
            p.articleNumber = Artikelnummer;
            Dao.DeleteProduct(p);



        }

        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {

        }
    }
}